package be.telio.freeagent.model;

import javax.xml.bind.annotation.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "invoice")
public class FAInvoice implements FAEntity, Serializable
{
    @XmlElement(name = "id")
    public Integer id;

    @XmlElement(name = "company-id")
    public Integer companyId;

    @XmlElement(name = "project-id")
    public Integer projectId;

    @XmlElement(name = "contact-id")
    public Integer contactId;

    @XmlElement(name = "dated-on")
    public Date datedOn;

    @XmlElement(name = "due-on")
    public Date dueOn;

    @XmlElement(name = "reference")
    public String reference;

    @XmlElement(name = "currency")
    public String currency;

    @XmlElement(name = "exchange-rate")
    public String exchangeRate;

    @XmlElement(name = "net-value")
    public Double netValue;

    @XmlElement(name = "sales-tax-value")
    public Double salesTaxValue;

    @XmlElement(name = "status")
    public String status;

    @XmlElement(name = "comments")
    public String comments;

    @XmlElement(name = "discount-percent")
    public Double discountPercent;

    @XmlElement(name = "omit-header")
    public Boolean omitHeader;

    @XmlElement(name = "payment-terms-in-days")
    public Integer paymentTermsInDays;

    @XmlElement(name = "written-off-date")
    public Date writtenOffDate;

    @XmlElement(name = "ec-status")
    public String ecStatus;

    @XmlElement(name = "invoice-item")
    @XmlElementWrapper(name = "invoice-items")
    public List<FAInvoiceItem> invoiceItems = new ArrayList<FAInvoiceItem>();

    public String getEntityListName()
    {
        return "invoices";
    }

    public Integer getId()
    {
        return id;
    }

}
